#include "global.h"
#include "Packet.h"

#ifndef CPU_H
#define CPU_H

typedef struct cpu{
    Queue allPCB; //store all pcb's and processes in here for easy destruction at the end. (call destructAll on the queue)
    unsigned int step_no; //the current count
    PCBPtr* running;      //the currently running process
    Queue readyQueue;     //the ready queue
    //depending on how we implement things we may need
        //io queues
        //io devices
        //mutex queues
        //mutex ptrs
        //condition variable queues
        //condition variables
        //shared memory

    //probably need a function ptr to easily change the scheduling type,
        //this will make it easy to plug in a different scheduling algorithm


}CPUStr;

typedef CPUStr* CPUPtr;



PacketPtr cpuStep();

//should have a check interrupt function to see if there is a interrupt waiting, then service it
    //& finish what we are doing.

//kernal space functions
    //scheduler
    //timer_int_handler
    //io_int_handler
    //io_req_trap_handler
    //mutex_lock_trap_handler
    //mutex_unlock_trap_handler
    //cond_wait_trap_handler
    //cond_signal_trap_handler

//user space functions
    //io_system_call
    //mutex_lock_system_call
    //mutex_unlock_system_call
    //cond_wait_system_call
    //cond_signal_system_call

//use an unsigned int for the steps so we don't have to worry about negative values when we mod the steps to get the counter

#endif

